package order

import (
	"context"
)

const (
	CreateOrderServicePluginId = "service:order:create:ext"
	CreateOrderDomainPluginId  = "domain:order:create:ext"
)

type CreateOrderServiceExt interface {
	OnValidate(ctx context.Context, in *OrderDTO) error
	Pre(ctx context.Context, in *OrderDTO) error
	Post(ctx context.Context, in *OrderDTO, out *OrderDTO) error
}

type CreateOrderDomainExt interface {
	/**
	业务规则检查，是否可以执行该扩展
	*/
	Check(ctx context.Context, in interface{}) bool
	OnValidate(ctx context.Context, in *Order) error
	PreSave(ctx context.Context, in *Order) error
}
